package com.lingxu.api.ztb.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lingxu.api.ztb.mapper.FeasibilityReviewMeetingMapper;
import com.lingxu.api.ztb.model.FeasibilityReviewMeeting;
import com.lingxu.api.ztb.model.vo.FeasibilityReviewMeetingVO;
import com.lingxu.api.ztb.service.IFeasibilityReviewMeetingService;


import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.core.metadata.IPage;


import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.util.List;
import java.util.Set;

/**
 * 工可专题审查会议表 服务实现类
 *
 * @author admin
 * @since 2025-08-12
 */
@Slf4j
@Service
public class FeasibilityReviewMeetingServiceImpl extends ServiceImpl<FeasibilityReviewMeetingMapper, FeasibilityReviewMeeting>  implements IFeasibilityReviewMeetingService {

    @Resource
    private FeasibilityReviewMeetingMapper feasibilityReviewMeetingMapper;

    @Transactional(readOnly = true)
    @Override
    public IPage<FeasibilityReviewMeetingVO> queryPageList(FeasibilityReviewMeetingVO query) {
        Page<FeasibilityReviewMeetingVO> page = new Page<FeasibilityReviewMeetingVO>(query.getPageNo(), query.getPageSize());
        return feasibilityReviewMeetingMapper.pageList(page,query);
    }


    @Transactional(readOnly = true)
    @Override
    public List<FeasibilityReviewMeetingVO> list(FeasibilityReviewMeetingVO query) {
        return feasibilityReviewMeetingMapper.selectFeasibilityReviewMeetingList(query);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void delete(Set<String> ids) {
        if (CollectionUtils.isNotEmpty(ids)) {
            feasibilityReviewMeetingMapper.deleteBatchIds(ids);
        }
    }

    @Override
    public String getApprovalDate(String projectName) {
        return feasibilityReviewMeetingMapper.getApprovalDate(projectName);
    }

}
